/*
 * @Description: 
 * @Version: 2.0
 * @Autor: snzo.chen
 * @Date: 2021-10-15 14:59:38
 * @LastEditors: snzo.chen
 * @LastEditTime: 2021-10-15 15:04:00
 */
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { Observable, map } from 'rxjs';
import { AnyJson } from './data-types/common.type';
import { ServicesModule } from './services.module';

@Injectable({
  providedIn: ServicesModule
})
export class PrizeNewsService {

  constructor(private http: HttpClient) { }
  getPrizeWorks(params: AnyJson): Observable<AnyJson> {
    return this.http.get('/prizeNews/getPrizeWorks', { params })
      .pipe(map(res => res as AnyJson));
  }

  cancelRecommend(params: AnyJson): Observable<AnyJson> {
    return this.http.get('/prizeNews/cancelRecommend', { params })
      .pipe(map((res) => res as AnyJson));
  }

  recommendGetPrizeWorks(params: AnyJson): Observable<AnyJson> {
    return this.http.post('/prizeNews/recommendGetPrizeWorks', params)
      .pipe(map((res) => res as AnyJson));
  }
}
